//
//  ApIBaseRequest.h
//  APIRequest
//
//  Created by LWW on 2021/10/15.
//  Copyright © 2021 Frank. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "NetworkHelper.h"
#import "APIBaseRequestHandler.h"

NS_ASSUME_NONNULL_BEGIN

//成功block
typedef void (^APISuccessBlock)(NSDictionary *data);
//失败block
typedef void (^APIFailureBlock)(NSError *error);

@interface APIBaseRequest : NSObject

/// reqeust对象
@property (nonatomic, strong) APIBaseRequestHandler* request;
/// 请求返回的原始数据
@property (nonatomic, copy) NSDictionary *responseData;
/// 请求返回error对象
@property (nonatomic, strong) NSError *responseError;
/// 请求的方式POST／GET
@property (nonatomic, strong) NSString *method;
/// 是否做缓存（默认是NO）
@property (nonatomic, assign) BOOL isCache;
/// 发起请求
- (void)apiRequestSuccess:(APISuccessBlock)successBlock
                  failure:(APIFailureBlock)failureBlock;

- (void)apiRequestUploadImagesMethod:(NSArray *)imagesArray urlfileName:(NSString *)urlfileName  url:(NSString *)url parameters:(id)parameters finishBlock:(void (^)(id data, NSError *error))finishBlock;


@end

NS_ASSUME_NONNULL_END
